package cn.yoaket.exception;

/**
 * @author Alex
 */
public class BoostStrapException extends Exception{
    public enum  Type{
        //格式不正确异常
        FORMAT_ERROR,
        //属性找不到异常
        FIELD_ERROR,
        //参数不正确异常
        PARAM_ERROR
    }

    final Type type;

    public BoostStrapException(Type type) {
        this.type = type;
    }

    @Override
    public String getMessage() {
        if(type.equals(Type.FORMAT_ERROR)) {
            return "格式不正确";
        }
        else if(type.equals(Type.FIELD_ERROR)){
            return "属性找不到";
        }
        else if(type.equals(Type.PARAM_ERROR)){
            return "方法参数不正确";
        }
        else{
            return "程序运行异常";
        }
    }
}
